﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MvcCarConsume.WebUI
{
    public class CategoryInView
    {
        public int? CategoryID { get; set; }
        public string CategoryName { get; set; }
        public string CategoryDescription { get; set; }
    }

    public class VMCategoryMenuControl
    {
        public IList<CategoryInView> Categories { get; set; }
        public VMCategoryMenuControl()
        {
            Categories = new List<CategoryInView>();
        }

        

        public void LoadCategories(IList<MvcCarConsume.Domain.Entites.Type> types)
        {
            foreach (var t in types)
            {
                Categories.Add(new CategoryInView
                {
                    CategoryID = t.TypeId,
                    CategoryName =t.TypeName,
                    CategoryDescription = t.Description
                });
            }
        }

    }
}